﻿
<!--
/**************************************************
* @ orderreviewview.jsp
*
* Copyright   2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/02/16, Simonyi Peng
*  1) first release
/**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ include file="../../common.jsp" %>
<%@ page import="com.hitrust.gs.business.GSOrganizationProcessor"%>
<%@ page import="com.hitrust.gs.business.GSOperatorProcessor"%>
<%@ taglib uri="/page.util.gs.hitrust.com/taglibs/page" prefix="page"%>

<%@page import="system.base.User"%>
<%@page import="framework.core.DBConnection"%>
<html>
<head>
<title>订单复审</title>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<!--<LINK href="<%=root%>/css/css.css" type=text/css rel=stylesheet>-->
<LINK href="<%=root%>/css/caigouxitong.css" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<%


	ArrayList tList = (ArrayList)request.getAttribute("detaillist");
	GSOrderBean tBean = (GSOrderBean)request.getAttribute("orderbean");
	
	//意见字段长度
	int memoLen = 800;	
	DBConnection con=DBConnection.open(true);
%>
<script language="JavaScript">
	var counter;
	function process_old(val){
		if(val == 'F'){
			orderreviewview.action = "<%=response.encodeURL(root+"/A100901.do")%>";
		}else if(val == 'R'){
				if(isEmpty(orderreviewview.auditcontent.value)){
					alert("审核意见不能为空!");
					return false;
				}
				if(confirm("是否确定复审不通过？")){
					orderreviewview.action = "<%=response.encodeURL(root+"/A100905.do")%>";			
					document.all.confirmorreject.value='F';
				}else{
					window.returnValue = "0";					
					window.close();
				}
		}
		orderreviewview.submit();
		window.returnValue="1";
		window.close();
	}

	function process(val){
		if(val == 'R'){
				if(isEmpty(orderreviewview.auditcontent.value)){
					alert("审核意见不能为空!");
					return false;
				}
				
				if (!judgeStrLen("auditcontent")) return false;
				
				if(confirm("是否确定复审不通过？")){
					window.returnValue=document.getElementById("auditcontent").value;
					window.close();
				}else{
					window.returnValue='0';
					window.close();
				}
		}
	}

	function judgeStrLen(name)
	{
		var str = document.getElementById(name).value;
		if (str == null || str.length == 0) return true;
		if (StrLen(str)><%=memoLen%>)
		{
			alert("审核意见长度不能超过<%=memoLen/2%>个汉字！");
			return false;
		}
		return true;
	}

</script>
</head>
<body BGCOLOR="#f2f2f2"	text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<p><br></p>
<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black">申购单内容</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>

<br>

<form name="orderreviewview" method="post" >

<input type="hidden" name="orderId" value="<%=tBean.getGs_order_tempid() %>">
<input type='hidden' name='confirmorreject' >
<center>
<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr> 
        <td> 
            <table class=bg_table id=tableId	cellspacing=1 cellpadding=2 width=100% align=center border=0>
                <tbody> 
                <tr class="bg_column" height=20> 
                    	<td align=middle colspan="11">申购单总体信息</td>
                </tr>
                <tr class="bg_row_odd" height=20> 
                	<td class=top align=middle width='20%' >
                	    <div align="center" class="txt_content">申购单编号</div>
                	</td>
                    <td class=top align=middle colspan=5> 
                        <div align="left" class="txt_content" > 
                        <%=tBean.getGs_order_tempid()%>
						</div>
                    </td>
                </tr>
                
                <tr class="bg_row_odd" height=20> 
                    <td class=top align=middle> 
                        <div align="center" class="txt_content">订货单位</div>
                    </td>
                    <td class=top align=center> 
                        <div align='left' class='txt_content'> 
                        <%GSOrganizationProcessor oproc = new GSOrganizationProcessor();%>
                        <%=oproc.getOrg(tBean.getGs_workcorp_id()).getGs_org_name()%>
                        </div>
                    </td>
	                <td class=top align=left> 
	                    <div align="center" class="txt_content">配送方式</div>
	                </td>
                    <td class=top align=middle> 
                        <div align='left' class='txt_content'> 
                        <%String tDeliverMode = tBean.getGs_deliver_mode();%>
                        	<%=com.hitrust.gs.service.GSBaseManager.getDictioanryName(tDeliverMode)%>
                        </div>
                    </td>
	                <td class=top align=middle> 
	                    <div align="center" class="txt_content">结算方式</div>
	                </td>
                    <td class=top align=middle> 
                        <div align='left' class='txt_content'> 
                        <%String tBalanceMode = tBean.getGs_balance_mode();%>
                        <%=com.hitrust.gs.service.GSBaseManager.getDictioanryName(tBalanceMode)%>
                        </div>
                    </td>
                </tr>
                <tr class="bg_row_odd" height=20> 
	                <td class=top align=middle> 
	                    <div align="center" class="txt_content">送货地址</div>
	                </td>
                    <td class=top align=middle> 
                        <div align='left' class='txt_content'> 
                        <%=tBean.getGs_deliver_goods_addr()%>
                        </div>
                    </td>
	                <td class=top align=middle> 
	                    <div align="center" class="txt_content">联系人</div>
	                </td>
                    
                    <td class=top align=middle > 
                        <div align='left' class='txt_content'> 
                        <%=tBean.getGs_order_contact_name()==null?"":tBean.getGs_order_contact_name()%>
                        </div>
                    </td>
	                <td class=top align=middle> 
	                    <div align="center" class="txt_content">联系电话</div>
	                </td>
                    
                    <td class=top align=middle > 
                        <div align='left' class='txt_content'> 
                        <%=tBean.getGs_order_contact_phone()==null?"":tBean.getGs_order_contact_phone()%>
                        </div>
                    </td>                
                </tr>
                
                <tr class="bg_row_odd" height=20> 
                    <td class=top align=middle> 
                        <div align="center" class="txt_content">备注</div>
                    </td>
                    <td class=top align=middle colspan='5'> 
                        <div align="left" class="txt_content"> 
                        <%=tBean.getGs_notes()%>
                        </div>
                    </td>
                </tr>
                <tr class="bg_row_odd" height=20> 
	                <td class=top align=middle> 
	                    <div align="center" class="txt_content">创建人</div>
	                </td>
                    <td class=top align=middle > 
                        <div align='left' class='txt_content'> 
                        <%
                        if (!"".equals(tBean.getGs_recorder_id()))
                        {
                            User user=User.fetch(con,tBean.getGs_recorder_id());
                            if (user != null)
                                out.print(user.getName());
                        }
                        %>
                        </div>
                    </td>
	                <td class=top align=middle> 
	                    <div align="center" class="txt_content">创建时间</div>
	                </td>
                    
                    <td class=top align=middle colspan=3> 
                        <div align='left' class='txt_content'> 
                        <%=tBean.getGs_order_create_date()%>
                        </div>
                    </td>
                </tr>                
                </tbody> 
            </table>
        </td>
    </tr>
</table>
</center>
<center>
<p><br></p>

    <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">

<%
	if(tList != null){
%>
		<tr>
			<td>
            	<table class=bg_table id=tableId	cellspacing=1 cellpadding=2 width=100% align=center border=0>
                    <tbody> 
	                <tr class="bg_column" height=20> 

                        <td class=top align=middle> 
                            <div align="center" class="txt_content"> 集中编码</div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content"> 产品名称</div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content"> 规格</div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content"> 型号</div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content"> 品牌</div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content"> 质保期</div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content"> 价格（元）</div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content"> 订货数量</div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content"> 单位</div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content"> 送货日期</div>
                        </td>
                        <td class=top align=middle> 
                            <div align="center" class="txt_content"> 送货时间</div>
                        </td>
                    </tr>
					<%
						if(tList != null && tList.size() > 0){
						for(int i=0; i<tList.size(); i++){
							String[] tStr = (String[])tList.get(i);
							String tTempStr="";
							if(i%2==0){
								tTempStr="class=\"bg_row_odd\"";
							}else {
								tTempStr="class=\"bg_row_even\"";
							}
					%>
							<tr <%=tTempStr%> height=20>
					
		                        <!--集中编码-->
		                        <td class=top align=middle nowrap>                         
		                            <div align="center" class="txt_content"> 
		                            <%=tStr[4]%>
									</div>
		                        </td>
		                        <!--产品名称-->
		                        <td class=top align=middle nowrap>                         
		                            <div align="center" class="txt_content"> 
		                            <a href="<%=response.encodeURL(root+"/A100306.do")%>?concentricityId=<%=tStr[4]%>" target=_blank><%=tStr[3]%></a>
									</div>
		                        </td>
		                        <!--规格-->
		                        <td class=top align=middle nowrap>                         
		                            <div align="center" class="txt_content"> 
		                            <%=tStr[8]%>
									</div>
		                        </td>
		                        <!--型号-->
		                        <td class=top align=middle nowrap>                         
		                            <div align="center" class="txt_content"> 
		                            <%=tStr[9]%>
									</div>
		                        </td>
		                        <!--品牌-->
		                        <td class=top align=middle nowrap>                         
		                            <div align="center" class="txt_content"> 
		                            <%=tStr[10]%>
									</div>
		                        </td>
		                        <!--质保期-->
		                        <td class=top align=middle nowrap>                         
		                            <div align="center" class="txt_content"> 
		                            <%=tStr[15]%>
									</div>
		                        </td>
		                        <!--参考价格-->
		                        <td class=top align=middle nowrap>                         
		                            <div align="center" class="txt_content"> 
		                            <%=tStr[14]%>
									</div>
		                        </td>
		                        <!--订货数量-->
		                        <td class=top align=middle> 
		                            <div align="center" class="txt_content"> 
		                            <%=StringUtils.format(tStr[5],2)%>
									</div>
		                        </td>
		                        <!--单位-->
		                        <td class=top align=middle> 
		                            <div align='center' class='txt_content'> 
		                            <%=tStr[11]%>
		                            </div>
		                        </td>
		                        <!--送货日期-->
		                        <td class=top align=middle nowrap> 
		                            <div align="center" class="txt_content">                             	
		                            <%=tStr[6]%>
		                            </div>
		                        </td>
		                        <!--送货时间-->
		                        <td class=top align=middle> 
		                            <div align='center' class='txt_content'> 
		                            <%=tStr[7]%>
		                            </div>
		                        </td>
							</tr> 
							
					<%	
							}
						}else{
					%>
							<font color="red">没有符合条件的产品</font>
					<%
						}
					%>
					</tbody>
				</table>
			</td>
		</tr>

<%		
	}
if(con!=null){
    con.close();
}
%>
	</table>
	</center>
	
    <table class=bg_table id=tableId	cellspacing=1 cellpadding=2 width=90% align=center border=0>
	    <tr class=bg_column height="20"><td class="bg_column" align="center" colspan=14>审核意见</td></tr>
		<tr class=bg_row_odd height="20">
			<td class="top" colspan=14 width="100%"><div class="txt_content">
				<textarea id="auditcontent" name ="auditcontent" style="WIDTH: 100%; HEIGHT: 50px" name="notes"><%=tBean.getGs_firstaudit_advices()==null?"":tBean.getGs_firstaudit_advices()%></textarea>
			</div></td>
		</tr>
	</table>

	
</form>
    <p align="center">  
    <input type="button" name="驳回" value="复审不通过" class="kuang" onclick="process('R')">
		<!-- <input type="image" src="images/button/dayin.gif" width="58" height="24" class="box" onclick="process('P')"/> -->&nbsp;
		<input type="button" value='取消' class="kuang" onclick="window.close();"/>&nbsp;		
    </p>
</body>
</html>